package com.example.dormitorysystem.exception;

import lombok.*;

/**
 * @author chen huilong
 * @since 2022-10-04
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CmsException extends RuntimeException {

    private Integer code;
    private String msg;

    public CmsException(ErrorCode errorCode) {
        super(errorCode.getMsg());
        this.code = errorCode.getCode();
        this.msg = errorCode.getMsg();
    }
}